package link.anyauto.dtbinding.list;

import android.databinding.DataBindingUtil;

import link.anyauto.dtbinding.R;
import link.anyauto.dtbinding.base.ActBase;
import link.anyauto.dtbinding.base.App;
import link.anyauto.dtbinding.databinding.ActListBinding;

/**
 * Created by Administrator on 2016/7/26.
 */
public class ActList extends ActBase {

    @Override
    protected void setupBinding() {
        binding = DataBindingUtil.setContentView(this, R.layout.act_list);
    }

    @Override
    protected void setupVM() {
        vm = new ListVM();
        vm.items.add(App.getStr(R.string.item_value_n, 5));
        vm.items.add(App.getStr(R.string.item_value_n, 4));
        vm.items.add(App.getStr(R.string.item_value_n, 3));
        vm.items.add(App.getStr(R.string.item_value_n, 2));
        vm.items.add(App.getStr(R.string.item_value_n, 1));
    }

    @Override
    protected void setupHandlers() {
        handlers = new ListHandlers();
    }

    @Override
    protected void justAfterSetup() {
        handlers.vm = vm;
        handlers.ctx = this;
        binding.setVm(vm);
        binding.setHandlers(handlers);
    }

    ActListBinding binding;
    ListHandlers handlers;
    ListVM vm;
}
